/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.fiu.cis.personalize.shared;

import java.io.Serializable;

/**
 * 
 * @author Reza
 */
@SuppressWarnings("serial")
public class GoogleDocument implements Serializable, Comparable<GoogleDocument> {
	private int id;
	private int googleRank;
	private String URL;
	private String title;
	private String content;
	private double objectRank;
	
	public void setId(int id) {
		this.id = id;
	}
	
	public int getId() {
		return id;
	}

	public void setObjectRank(double objectRank) {
		this.objectRank = objectRank;
	}

	public double getObjectRank() {
		return objectRank;
	}

	public int getGoogleRank() {
		return googleRank;
	}

	public void setGoogleRank(int id) {
		this.googleRank = id;
	}

	public GoogleDocument() {
		// TODO Auto-generated constructor stub
	}

	public GoogleDocument(String URL) {
		this.URL = URL;
	}

	public GoogleDocument(int googleRank, String uRL, String title, String content) {
		super();
		this.googleRank = googleRank;
		URL = uRL;
		this.title = title;
		this.content = content;
	}

	/**
	 * 
	 * @return The link to the document on the web
	 */
	public String getURL() {
		return URL;
	}

	public void setURL(String URL) {
		this.URL = URL;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String toString() {
		return URL;
	}

	@Override
	public int compareTo(GoogleDocument o) {
		if (o.objectRank == this.objectRank) {
			return 0;
		}

		return o.objectRank > this.objectRank ? 1 : -1;
	}
}
